const CryptoJs = require('crypto-js')

function decrypt_data(t) {
    var e = CryptoJs.enc.Utf8.parse('EB444973714E4A40876CE66BE45D5930')
        , n = CryptoJs.enc.Utf8.parse('B5A8904209931867')
        , a = CryptoJs.AES.decrypt(t, e, {
        iv: n,
        mode: CryptoJs.mode.CBC,
        padding: CryptoJs.pad.Pkcs7
    });
    return JSON.parse(a.toString(CryptoJs.enc.Utf8))
}

// t = 'MZphJmFlelDpw2aSCfdFb+OHiSQ4j2DR7JuitT/BQGTYEbv0ltY7P7XqKh/WcMeRs3YMzP2ZxsjSHeY0znOUcvQDLNRVA+CvTS1gMc/8fz8Q9EEoG1QZ5CM5GfZUfF+Y4r7KfdKqTChzyaDCObtFqC6YwDjOhVaFw3dfjnTcqcjOLwEZPy6mq3gyG9Oo3zXSJ3R1G9I7faAPw3i7SXZbxzAaFOemgdHGvkcr3ajbRDYUVAE7UUUOodIK1+iKMsCWVA03YFvmEz/8/HXwpDfQvP2gEyq4+9Ytx0IJsYK86B5cusPIiCKfiZ20I8D8NmEQBWxknXb836u+TjxEWmkfK9btiGOP7QhzRaX3+WiATxvSkjfzO5k5pn+vFuotBQb8C1j75BsmiHi+voGHBGVV5R/ezWDS93sPWBCjB7KvCyR067aabgkKzgyXNs6ok/7FmzO5PNBcs2kMgGjtgVBf29TMmrpXJpYXFXkC/8BH0CvL5Sz8rEZNAQ03Amc1vk3mmz6Zt0uAAPslnALOwZTXf+hN61Ri8oZJIfgWPLyNC/i6UBtMd9XbjDQq3R+bfxpY76JLjKGAJPdGi9nJtAQTwEMdkvBtXYI0Mtaf99h/iVMxSs8UANoHpWH5c4tEN2z7jCvDpaYBLaN0oprESOxAseGI6/NAy7pnSens92Ito4EqJzYUUCSW1dIdyVk0M9/mQP6+x0RR+Joy1ug1IibhdH7Wo6rq0FCetK6R6KrNFVvWp6XghwyRo46FmeIan8R2MOlFSHLDASeWc8Vg1nOOUjAetK38KqDScdHM5tnsUkapLl2psb39ChU6PnqsPdySl9l5AkcNqqQj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hjQ9NM3vNBP9ZLlSRHFPGkul9Zg5pg5qdQEQuzH/h1YqTTOWSVqilvJ1bS9MJQ=='
// console.log(b(t))

function get_sign(t) {
    for (var e in t)
        "" !== t[e] && void 0 !== t[e] || delete t[e];
    var n = 'B3978D054A72A7002063637CCDF6B2E5' + u(t);
    return s(n).toLocaleLowerCase()
}

function u(t) {
    for (var e = Object.keys(t).sort(l), n = "", a = 0; a < e.length; a++)
        if (void 0 !== t[e[a]])
            if (t[e[a]] && t[e[a]] instanceof Object || t[e[a]] instanceof Array) {
                var i = JSON.stringify(t[e[a]]);
                n += e[a] + i
            } else
                n += e[a] + t[e[a]];
    return n
}
function l(t, e) {
    return t.toString().toUpperCase() > e.toString().toUpperCase() ? 1 : t.toString().toUpperCase() == e.toString().toUpperCase() ? 0 : -1
}
function s(input) {
    // 计算 MD5 哈希值
    const hash = CryptoJs.MD5(input).toString(CryptoJs.enc.Hex);
    return hash;
}

console.log(get_sign({
    "type": "12",
    "IS_IMPORT": 1,
    "pageSize": 3,
    "ts": 1723615226100
}))
// 70854bf1b57f44d8e7cbc0b4b62d77de
// 70854bf1b57f44d8e7cbc0b4b62d77de
